Power management of branch predictors in a computer processor

ABSTRACT

A computer processor includes a branch prediction unit that includes a local branch predictor and a global branch predictor. Managing power consumption in such a computer processor includes, for each of a plurality of branch instructions: performing, by the local branch predictor, a local branch prediction; performing, by each of the global branch predictors, a global branch prediction; determining to utilize the local branch prediction over the global branch predictions as a branch prediction for the branch instruction; incrementing a value of a counter; determining whether the value of the counter exceeds a predetermined threshold; and if the value of the counter exceeds the predetermined threshold, powering down at least one of the global branch predictors and configuring the branch prediction unit to bypass the powered down global branch predictor for branch predictions of subsequent branch instructions.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a continuation application of and claims priorityfrom U.S. patent application Ser. No. 15/165,439, filed on May 26, 2016.

BACKGROUND Field of the Invention

The field of the present disclosure is data processing, or, morespecifically, methods, apparatus, and computer processors configured forpower management.

Description of Related Art

The development of the EDVAC computer system of 1948 is often cited asthe beginning of the computer era. Since that time, computer systemshave evolved into extremely complicated devices. Today's computers aremuch more sophisticated than early systems such as the EDVAC. Computersystems typically include a combination of hardware and softwarecomponents, application programs, operating systems, processors, buses,memory, input/output devices, and so on. As advances in semiconductorprocessing and computer architecture push the performance of thecomputer higher and higher, more sophisticated computer software hasevolved to take advantage of the higher performance of the hardware,resulting in computer systems today that are much more powerful thanjust a few years ago.

One area of computer system technology that has advanced is computerprocessors. As the number of computer systems in data centers and thenumber of mobile computing devices has increased, the need for moreefficient computer processors has also increased. Speed of operation andpower consumption are just two areas of computer processor technologythat affect efficiency of computer processors. Branch prediction is oneform of increasing speed of operation in computer processors, but suchbranch prediction also consumes additional power.

SUMMARY

Methods and apparatus of power management of a computer processor andcomputer processors configured for such power management are disclosedin this specification. Such a computer processor may include a branchprediction unit, where the branch prediction unit includes a localbranch predictor and a plurality of global branch predictors. In someembodiments, the global branch predictors include a Tagged Geometric(‘TAGE’) branch predictor. For each of a plurality of branchinstructions, the computer processor may carry out: performing, by thelocal branch predictor, a local branch prediction; performing, by eachof the global branch predictors, a global branch prediction; determiningto utilize the local branch prediction over the global branchpredictions as a branch prediction for the branch instruction;incrementing a value of a counter; determining whether the value of thecounter exceeds a predetermined threshold; and if the value of thecounter exceeds the predetermined threshold, powering down at least oneof the global branch predictors and configuring the branch predictionunit to bypass the powered down global branch predictor for branchpredictions of subsequent branch instructions.

The foregoing and other objects, features and advantages of theinvention will be apparent from the following more particulardescriptions of exemplary embodiments of the invention as illustrated inthe accompanying drawings wherein like reference numbers generallyrepresent like parts of exemplary embodiments of the invention.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 sets forth a block diagram of an example system configured forbranch prediction in a computer processor according to embodiments ofthe present invention.

FIG. 2 sets forth a block diagram of a portion of a multi-sliceprocessor according to embodiments of the present invention.

FIG. 3 sets forth a block diagram of another portion of a multi-sliceprocessor according to embodiments of the present invention.

FIG. 4 sets forth a flow chart illustrating an exemplary method forbranch prediction in a computer processor.

FIG. 5 sets forth a flow chart illustrating a further exemplary methodfor branch prediction in a computer processor.

FIG. 6 sets forth a flow chart illustrating a further exemplary methodfor branch prediction in a computer processor.

DETAILED DESCRIPTION

Exemplary methods and apparatus for managing power consumption in acomputer processor in accordance with the present invention aredescribed with reference to the accompanying drawings, beginning withFIG. 1. FIG. 1 sets forth a block diagram of an example systemconfigured for power management in a computer processor according toembodiments of the present invention. The system of FIG. 1 includes anexample of automated computing machinery in the form of a computer(152).

The computer (152) of FIG. 1 includes at least one computer processor(156) or ‘CPU’ as well as random access memory (168) (‘RAM’) which isconnected through a high speed memory bus (166) and bus adapter (158) toprocessor (156) and to other components of the computer (152).

The example computer processor (156) of FIG. 1 may be implemented as amulti-slice processor. The term ‘multi-slice’ as used in thisspecification refers to a processor having a plurality of similar oridentical sets of components, where each set may operate independentlyof all the other sets or in concert with the one or more of the othersets. The multi-slice processor (156) of FIG. 1, for example, includesseveral execution slices (‘ES’) and several load/store slices (‘LSS’).Each execution slice may be configured to provide components thatsupport execution of instructions: an issue queue, general purposeregisters, a history buffer, an arithmetic logic unit (212) (including avector scalar unit, a floating point unit, and others), and the like.Each of the load/store slices may be configured with components thatsupport data movement operations such as loading of data from cache ormemory or storing data in cache or memory. In some embodiments, each ofthe load/store slices includes a data cache. The load/store slices arecoupled to the execution slices through a results bus. In someembodiments, each execution slice may be associated with a singleload/store slice to form a single processor slice. In some embodiments,multiple processor slices may be configured to operate together.

The example multi-slice processor (156) of FIG. 1 may also include, inaddition to the execution and load/store slices, other processorcomponents. In the system of FIG. 1, the multi-slice processor (156)includes fetch logic, dispatch logic, and branch prediction logic.Further, although in some embodiments each load/store slice includescache memory, the multi-slice processor (156) may also include cacheaccessible by any or all of the processor slices.

Although the multi-slice processor (156) in the example of FIG. 1 isshown to be coupled to RAM (168) through a front side bus (162), a busadapter (158) and a high speed memory bus (166), readers of skill in theart will recognize that such configuration is only an exampleimplementation. In fact, the multi-slice processor (156) may be coupledto other components of a computer system in a variety of configurations.For example, the multi-slice processor (156) in some embodiments mayinclude a memory controller configured for direct coupling to a memorybus (166). In some embodiments, the multi-slice processor (156) maysupport direct peripheral connections, such as PCIe connections and thelike.

Stored in RAM (168) in the example computer (152) is a data processingapplication (102), a module of computer program instructions that whenexecuted by the multi-slice processor (156) may provide any number ofdata processing tasks. Examples of such data processing applications mayinclude a word processing application, a spreadsheet application, adatabase management application, a media library application, a webserver application, and so on as will occur to readers of skill in theart. Also stored in RAM (168) is an operating system (154). Operatingsystems useful in computers configured for operation of a multi-sliceprocessor according to embodiments of the present invention includeUNIX™, Linux™, Microsoft Windows™, AIX™, IBM's z/OS™, and others as willoccur to those of skill in the art. The operating system (154) and dataprocessing application (102) in the example of FIG. 1 are shown in RAM(168), but many components of such software typically are stored innon-volatile memory also, such as, for example, on a disk drive (170).

The computer (152) of FIG. 1 includes disk drive adapter (172) coupledthrough expansion bus (160) and bus adapter (158) to processor (156) andother components of the computer (152). Disk drive adapter (172)connects non-volatile data storage to the computer (152) in the form ofdisk drive (170). Disk drive adapters useful in computers configured foroperation of a multi-slice processor according to embodiments of thepresent invention include Integrated Drive Electronics (‘IDE’) adapters,Small Computer System Interface (‘SCSI’) adapters, and others as willoccur to those of skill in the art. Non-volatile computer memory alsomay be implemented for as an optical disk drive, electrically erasableprogrammable read-only memory (so-called ‘EEPROM’ or ‘Flash’ memory),RAM drives, and so on, as will occur to those of skill in the art.

The example computer (152) of FIG. 1 includes one or more input/output(‘I/O’) adapters (178). I/O adapters implement user-orientedinput/output through, for example, software drivers and computerhardware for controlling output to display devices such as computerdisplay screens, as well as user input from user input devices (181)such as keyboards and mice. The example computer (152) of FIG. 1includes a video adapter (209), which is an example of an I/O adapterspecially designed for graphic output to a display device (180) such asa display screen or computer monitor. Video adapter (209) is connectedto processor (156) through a high speed video bus (164), bus adapter(158), and the front side bus (162), which is also a high speed bus.

The exemplary computer (152) of FIG. 1 includes a communications adapter(167) for data communications with other computers (182) and for datacommunications with a data communications network (100). Such datacommunications may be carried out serially through RS-232 connections,through external buses such as a Universal Serial Bus (‘USB’), throughdata communications networks such as IP data communications networks,and in other ways as will occur to those of skill in the art.Communications adapters implement the hardware level of datacommunications through which one computer sends data communications toanother computer, directly or through a data communications network.Examples of communications adapters useful in computers configured foroperation of a multi-slice processor according to embodiments of thepresent invention include modems for wired dial-up communications,Ethernet (IEEE 802.3) adapters for wired data communications, and 802.11adapters for wireless data communications.

The arrangement of computers and other devices making up the exemplarysystem illustrated in FIG. 1 are for explanation, not for limitation.Data processing systems useful according to various embodiments of thepresent invention may include additional servers, routers, otherdevices, and peer-to-peer architectures, not shown in FIG. 1, as willoccur to those of skill in the art. Networks in such data processingsystems may support many data communications protocols, including forexample TCP (Transmission Control Protocol), IP (Internet Protocol),HTTP (HyperText Transfer Protocol), WAP (Wireless Access Protocol), HDTP(Handheld Device Transport Protocol), and others as will occur to thoseof skill in the art. Various embodiments of the present invention may beimplemented on a variety of hardware platforms in addition to thoseillustrated in FIG. 1.

For further explanation, FIG. 2 sets forth a block diagram of a portionof a multi-slice processor according to embodiments of the presentinvention. The multi-slice processor in the example of FIG. 2 includes adispatch network (202). The dispatch network (202) includes logicconfigured to dispatch instructions for execution among executionslices.

The multi-slice processor in the example of FIG. 2 also includes anumber of execution slices (204 a, 204 b-204 n). Each execution sliceincludes general purpose registers (206) and a history buffer (208). Thegeneral purpose registers and history buffer may sometimes be referredto as the mapping facility, as the registers are utilized for registerrenaming and support logical registers.

The general purpose registers (206) are configured to store the youngestinstruction targeting a particular logical register and the result ofthe execution of the instruction. A logical register is an abstractionof an architectural register that enables out-of-order execution ofinstructions that target the same architectural register.

When a younger instruction targeting the same particular logicalregister is received, the entry in the general purpose register is movedto the history buffer. The history buffer (208) may be configured tostore many identifiers of instructions targeting the same logicalregister. That is, the general purpose register is generally configuredto store a single, youngest instruction identifier for each logicalregister while the history buffer may store many identifiers ofnon-youngest instructions for each logical register.

Each execution slice (204) of the multi-slice processor of FIG. 2 alsoincludes an execution reservation station (210). The executionreservation station (210) may be configured to issue instructions forexecution. The execution reservation station (210) may include an issuequeue. The issue queue may include an entry for each operand of aninstruction. The execution reservation station may issue the operandsfor execution by an arithmetic logic unit or to a load slice (222 a, 222b-222 n) via the results bus (220).

The arithmetic logic unit depicted in the example of FIG. 2 may becomposed of many components, such as add logic, multiply logic, floatingpoint units, vector/scalar units, and so on. Once an arithmetic logicunit executes an operand, the result of the execution may be stored inthe result buffer (214) or provided on the results bus (220) through amultiplexer (216).

The results bus may be configured in a variety of manners and becomposed in a variety of sizes. In some instances, each execution slicemay be configured to provide results on a single bus line of the resultsbus (220). In a similar manner, each load/store slice may be configuredto provide results on a single bus line of the results bus (220). Insuch a configuration, a multi-slice processor with four processor slicesmay have a results bus with eight bus lines—four bus lines assigned toeach of the four load/store slices and four bus lines assigned to eachof the four execution slices. Each of the execution slices may beconfigured to snoop results on any of the bus lines of the results bus.In some embodiments, any instruction may be dispatched to a particularexecution unit and then by issued to any other slice for performance. Assuch, any of the execution slices may be coupled to all of the bus linesto receive results from any other slice. Further, each load/store slicemay be coupled to each bus line in order to receive an issue load/storeinstruction from any of the execution slices. Readers of skill in theart will recognize that many different configurations of the results busmay be implemented.

The multi-slice processor in the example of FIG. 2 also includes anumber of load/store slices (222 a, 222 b-222 n). Each load/store sliceincludes a queue (224), a multiplexer (228), a data cache (232),unaligned data logic (234) and formatting logic (226). The queuereceives load and store operations to be carried out by the load/storeslice (222).

The unaligned data logic (234) of each slice is coupled to the unaligneddata logic of another slice through the unaligned data line (236). Theunaligned data logic (234) enables data to be stored and retrievedacross multiple load/store slices. The formatting logic (226) formatsdata into a form that may be returned on the results bus (220) to anexecution slice as a result of a load instruction.

For further explanation, FIG. 3 sets forth a block diagram of anotherportion of a multi-slice processor according to embodiments of thepresent invention. The example multi-slice processor of FIG. 3 includespre-decode logic (302) configured to retrieve instructions from memory,perform a preliminary decode of the instruction and store thepre-decoded instruction into an instruction cache (304).

The example multi-slice processor of FIG. 3 also includes a branchprediction unit (310). Branch prediction units generally perform branchprediction for pre-decoded instructions and track various branchprediction statistics for executing and executed instructions. Thebranch prediction unit (310) may include or access various registers andstorage that contain such branch prediction statistics. Further, thebranch prediction unit may include several types of predictors, or logicthat provides a branch prediction. In the example of FIG. 3, the branchprediction unit (310) includes a local predictor (312), and severalglobal predictors (314) including a TAGE (‘Tagged Geometric’) predictor(324). Each predictor may be configured to provide a branch predictionof increasing accuracy at the cost of power consumption, complexity oflogic, size of history to store branch statistics, and time to calculatethe prediction. The local predictor, for example, may be configured tomake a prediction based solely on the address of the branch instruction.Such a prediction may be calculated quickly and may utilize fewerresources than a prediction calculated by the global branch predictors.Some of the global branch predictors (314), in the example of FIG. 3,may utilize, in addition to the branch address, a global history vectorthat is maintained during operation. Such a global history vector may berelatively short, 20 bits for example, containing the history of thelast 20 branches. The branch address and global history vector mayundergo an Exclusive OR (XOR) operation. The result of such operationmay provide an index into a global branch history table (316). Such aglobal branch history table (316) may be configured to store statisticsrelated to branch history for a plurality of branches. Further, a globalselector (320) may be retrieved. The global selector (320) may indicatethat the global branch predictor is to be utilized over the local branchprediction when the two do not match. Also, a global count cache (322)may be accessed for a global branch prediction. The global count cachemaintains counters for relative branch instructions for use indetermining how many instructions to jump when a branch prediction ismade.

The TAGE predictor (324) likewise utilizes a tagged branch history table(326) which stores statistics on a plurality of branch instructions andeach entry is tagged. In addition to the global history vector which maybe relatively short, the TAGE may utilize a much longer global historybuffer. Such a buffer may include 100 bits of branch history. Further,the TAGE is indexed by a tag that is instruction specific. While theTAGE predictor provides the greatest accuracy of the three types ofpredictors, the TAGE predictor requires a very large, and thus powerconsuming, set of arrays, to maintain the Tagged branch history table.As explained below, with respect to FIGS. 4-6, the multi-slice processorin the example of FIG. 3 may be configured to manage power consumptionthrough control of various portions of the branch prediction unit.

Readers of skill in the art will recognize that the TAGE predictor (324)depicted in FIG. 3 is but one example of a global TAGE predictor whichmay be implemented in the processor of FIG. 3. As mentioned above, someTAGE predictors may utilize a long, 100 bit branch history to performbranch predictors. Some TAGE predictors, however, may utilize a muchshorter 20-bit global history vector. In such an embodiment, those thatuse shorter global history vector may be powered down when before thelonger TAGE predictors when managing power consumption as set forthbelow.

The example multi-slice processor of FIG. 3 also includes an instructionfetch unit (306). An instruction fetch unit (306) generally retrievesinstructions from the instruction cache and provides the fetchedinstruction to instruction decode logic (308).

The example instruction decode logic (308) of FIG. 3 performs a finaldecode operation on the fetched instructions and provides the decodedinstructions to the dispatch network (202). The dispatch network asdescribed above, dispatches the decoded instructions among slices.

For further explanation, FIG. 4 sets forth a flow chart illustrating anexemplary method for power management in a computer processor, such asthe multi-slice processor in the example of FIG. 2 and FIG. 3. Such acomputer processor includes a branch prediction unit which in turnincludes a local branch predictor and a plurality of global branchpredictors. A local branch predictor comprises logic, circuitry, andstorage configured for calculation of a local branch prediction. Aglobal branch predictor comprises logic, circuitry, and storageconfigured for calculation of a global branch prediction.

The method of FIG. 4 includes receiving (402), by the branch predictionunit, a branch instruction (404). Receiving (402) a branch instruction(404) may be carried out in a variety of ways. In some embodiments,pre-decode logic is configured to provide such branch instructions tothe branch prediction unit. In other embodiments, the branch predictionunit may be configured to monitor an instruction cache for newly addedbranch instructions.

The method of FIG. 4 also includes performing (406), by the local branchpredictor, a local branch prediction and performing (408), by the globalbranch predictors, a global branch prediction. As explained above,performing a local branch prediction may be carried out utilizing thebranch address of the branch instruction, while a global branchprediction may be performed by XORing the branch address with a 20-bithistory vector, and a global branch prediction in the form of a TAGEprediction may be carried out utilizing a 100-bit history buffer as wellas a TAG that uniquely identifies the branch instruction. Additionally,the local and global branch predictors may make use of a cache ofcounters where each counter indicates a number of instructions to jumpto in the case of a predicted taken relative branch.

The method of FIG. 4 includes determining (414) whether to utilize thelocal branch prediction (412) over the global branch predictions (410)as a branch prediction for the branch instruction. Each global branchprediction may include as a result of the prediction, a selector thatindicates whether to utilize the global branch prediction instead of thelocal branch prediction. Thus, to determine whether to utilize the localor global, the branch prediction unit inspects the value of the selectoras retrieved from the global branch predictions.

If the branch prediction unit determines to utilize the global branchprediction, the method of FIG. 4 continues by providing (416) the globalbranch prediction (410) to instruction fetch logic. Such a predictionwill be utilized by the instruction fetch unit if the branch predictionis taken. If, however, the branch prediction unit determines to utilizethe local prediction, the method of FIG. 4 continues by providing (418)the local branch prediction (412) to the instruction fetch unit.

In some instances, an instruction stream may include many repetitions ofthe same set of instructions. Further, such instructions may include oneor more branch instructions that are easily predicted by the localbranch predictors. In such a case, power is needlessly consumed by theglobal branch predictor arrays (storage) and other logic.

To that end, the method of FIG. 4 also includes incrementing (420) avalue (422) of a counter. That is, upon each use of the local branchpredictor over a global branch predictor, the branch prediction unitincreases the counter value. In effect, the branch prediction unitcounts the number of local branch predictions utilized over time. Such acounter may be maintained within or as logic separate from the branchprediction unit.

The method of FIG. 4 also includes determining (426) whether the value(422) of the counter exceeds a predetermined threshold (424). Thepredetermined threshold may be user specified or defined in thearchitecture of the processor. In some embodiments, the predeterminedthreshold may be 63, where the counter is initialized at 0, such that 64local branch predictions are made prior to the counter exceeding thepredetermined threshold.

If the counter value (422) does not exceed the predetermined threshold,the method of FIG. 4 continues by repeating the process upon receipt ofa subsequent branch instruction. If the value (422) of the counterexceeds the predetermined threshold (424) the method of FIG. 4 continuesby powering down (428) at least one of the global branch predictors andconfiguring (430) the branch prediction unit to bypass the powered downglobal branch predictor for branch predictions of subsequent branchinstructions.

Powering down (428) at lease one of the global branch predictors may becarried out in various ways. In some embodiments, for example, poweringdown (428) at least one of the global branch predictors may be carriedout by prohibiting clocking of a global branch history table, a globalselector, and a global count cache. In this way, subsequent branchinstructions will utilize only the non-powered down branch predictorsand the powered-down global branch predictor will not consume power.Such a mode of operation may be referred to as a “local good mode.” Insuch a mode, the powered-down branch predictors are not utilized to makebranch predictions. Another mode, described below is a “local very goodmode” in which only the local branch predictor is used and all globalbranch predictors are powered down.

For further explanation, FIG. 5 sets forth a flow chart illustrating anexemplary method for power management in a computer processor in whichat least one global branch predictor is powered down, but a globalbranch predictor in the form of a TAGE branch predictor has not yet beenpowered down.

TAGE prediction allows entries of a branch history table to beindividually addressable through the use of a tag (or identifier). TheTAGE predictor may include multiple paths that each use history vectorsof differing lengths that form a geometric series. This may enablebranch predictions to be based upon correlations that exist with recentbranch outcomes as well as with older branch outcomes of a particularbranch instruction.

In some embodiments, as mentioned above, the TAGE branch predictor mayutilize a much longer branch history as well as a TAG to perform abranch predictor. After a global branch predictor other than the TAGEhas been powered down, it may be useful to maintain the TAGE predictionsfor some time to ensure that the current pattern of branch instructionswhich lend well to local prediction continues. The TAGE branchprediction, utilizing such a long history relative to other globalbranch predictors, increases the probability that the pattern of branchinstructions will continue. As such, it may be useful in some instancesto keep the global, TAGE branch predictor powered on while other globalbranch predictors that utilize less history are powered down.

Such a prediction, while likely more accurate than a local or globalbranch prediction, may be more time consuming than either or more powerconsuming. To that end, the method of FIG. 5 generally sets forth amethod to power down the TAGE predictor after other global branchpredictors have been powered down as seen in FIG. 4.

As such, the method of FIG. 5 begins from step (430) of FIG. 4. That is,only after the other global branch predictors have been powered down andthe branch prediction unit has been configured to prohibit branchpredictions from the powered down global branch predictors does themethod of FIG. 5 begin.

The method of FIG. 5 includes receiving (502) a subsequent branchinstruction (504). The term ‘subsequent’ here refers to a branchinstruction received after the other, non-TAGE, global branch predictorshave been powered down in FIG. 4.

The method of FIG. 5 also includes performing (506) a local branchprediction (512) and a performing (508) a TAGE (510) branch prediction(510). Again, as noted above, the local branch prediction requires farless power consumption than the TAGE branch prediction.

The method of FIG. 5 continues by determining (514) whether to utilizethe local branch prediction (512) over the TAGE branch prediction (510)for the subsequent branch instruction. If the branch prediction unitdetermines to utilize the TAGE branch prediction, the method of FIG. 5continues by providing (516), to the instruction fetch logic, the TAGEbranch prediction (510). If, however, the branch prediction unitdetermines to utilize the local branch prediction (512) over the TAGEprediction, the method of FIG. 5 continues by providing (518) the localbranch prediction (512) to the instruction fetch logic and incrementing(520) the value of the counter.

In some embodiments, the counter in the method of FIG. 5 is the same asthe counter in the method of FIG. 4. The value of which was previouslyset in FIG. 4 when the branch prediction unit incremented the counterpast the predetermined threshold. That is, for example, the branchprediction unit, when determining to utilize the local branch predictionin the method of FIG. 4, incremented the counter value past thepredetermined value of 63 to a value of 64. In the present method, thebranch prediction unit, on the first branch instruction received afterpowering down the global branch predictor and after determining toutilize a local branch prediction for the branch instruction rather thanthe TAGE branch prediction, increments the value of the counter from 64to 65.

The method of FIG. 5 also includes determining (524) whether the value(422) of the counter exceeds a second predetermined threshold (522). Thesecond predetermined threshold may be greater than the first. In someembodiments, for example, the first predetermined threshold is 63 whilethe second predetermined threshold is 127.

If the value (422) of the counter exceeds the second predeterminedthreshold (522), the method of FIG. 5 continues by powering down (526)the TAGE branch predictor and configuring (528) the branch predictionunit to bypass the TAGE branch predictor for branch predictions ofsubsequent branch instructions. Powering down (526) the TAGE branchpredictor may be carried out by prohibiting clocking of logic, arrays,and other circuitry of the TAGE branch predictor.

Once all global branch predictors have been powered down, including theTAGE branch predictor, the processor is said to be operating in a “localvery good” mode of operation. In such a mode, it is highly likely thatthe local branch predictor will provide accurate branch prediction formany subsequent branch instructions and all global branch predictors areno longer consuming power.

At some point, however, the computer instruction stream may change sothat the branches are no longer easy to calculate with local branchprediction. To that end, the method of FIG. 6 sets forth a flow chartillustrating another exemplary method for power management in a computerprocessor. The method of FIG. 6 is similar to the method of FIG. 4including, as it does receiving (402) a branch instruction; performing(406) a local branch prediction; performing (408) a global branchprediction; determining (414) to utilize the local branch predictionover the global branch prediction as a branch prediction for the branchinstruction; incrementing (420) a value of a counter; determining (426)that the value (422) of the counter exceeds a predetermined threshold(424); powering down (428) at least one of the global branch predictorsand configuring (430) the branch prediction unit to bypass the powereddown global branch predictor for branch predictions of subsequent branchinstructions.

The method of FIG. 6 differs from the method of FIG. 4, however, in thatthe method of FIG. 4 includes initializing (602) the value of thecounter and if the branch prediction unit has been configured to bypassthe global branch predictor, reconfiguring (604) the branch predictionunit utilize the global branch predictor. Such a reconfiguration mayinclude powering up the previously powered down global branchpredictors.

In some embodiments such initialization (602) of the counter value (422)and reconfiguration (604) of the global branch predictors may be carriedout upon a branch misprediction (606). The misprediction is anindication that the set of instructions being executed may not repeat inthe same fashion as before and thus, the global branch predictions maybe necessary to more accurately calculate branch predictions.

In some embodiments, an exception in instruction execution may cause aflush (608). Responsive to such a flush, the branch prediction unit mayinitialize the counter value (422) and reconfigure (604) the globalbranch predictors.

The present invention may be a system, a method, and/or a computerprogram product. The computer program product may include a computerreadable storage medium (or media) having computer readable programinstructions thereon for causing a processor to carry out aspects of thepresent invention.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firewalls, switches, gateway computers and/oredge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present invention may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, or either source code or object code written in anycombination of one or more programming languages, including an objectoriented programming language such as Smalltalk, C++ or the like, andconventional procedural programming languages, such as the “C”programming language or similar programming languages. The computerreadable program instructions may execute entirely on the user'scomputer, partly on the user's computer, as a stand-alone softwarepackage, partly on the user's computer and partly on a remote computeror entirely on the remote computer or server. In the latter scenario,the remote computer may be connected to the user's computer through anytype of network, including a local area network (LAN) or a wide areanetwork (WAN), or the connection may be made to an external computer(for example, through the Internet using an Internet Service Provider).In some embodiments, electronic circuitry including, for example,programmable logic circuitry, field-programmable gate arrays (FPGA), orprogrammable logic arrays (PLA) may execute the computer readableprogram instructions by utilizing state information of the computerreadable program instructions to personalize the electronic circuitry,in order to perform aspects of the present invention.

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that can directa computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture including instructions which implement aspects ofthe function/act specified in the flowchart and/or block diagram blockor blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof instructions, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the block may occur out of theorder noted in the figures. For example, two blocks shown in successionmay, in fact, be executed substantially concurrently, or the blocks maysometimes be executed in the reverse order, depending upon thefunctionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustration, and combinations of blocksin the block diagrams and/or flowchart illustration, can be implementedby special purpose hardware-based systems that perform the specifiedfunctions or acts or carry out combinations of special purpose hardwareand computer instructions.

It will be understood from the foregoing description that modificationsand changes may be made in various embodiments of the present inventionwithout departing from its true spirit. The descriptions in thisspecification are for purposes of illustration only and are not to beconstrued in a limiting sense. The scope of the present invention islimited only by the language of the following claims.

What is claimed is:
 1. A method of power management in a computerprocessor, the computer processor comprising a branch prediction unit,the branch prediction unit comprising a local branch predictor and aplurality of global branch predictors, the method comprising: for eachof a plurality of branch instructions: performing, by the local branchpredictor, a local branch prediction; performing, by each of the globalbranch predictors, a global branch prediction; determining to utilizethe local branch prediction over the global branch predictions as abranch prediction for the branch instruction; incrementing a value of acounter; determining whether the value of the counter exceeds apredetermined threshold; and if the value of the counter exceeds thepredetermined threshold, powering down at least one of the global branchpredictors and configuring the branch prediction unit to bypass thepowered down global branch predictor for branch predictions ofsubsequent branch instructions, wherein at least one of the globalbranch predictors comprises a TAGE (‘Tagged Geometric’) branchpredictor; and after configuring the branch prediction unit to bypass atleast one of the global branch predictors for branch predictions ofsubsequent branch instructions, the method further comprises for eachsubsequent branch instruction: performing, by the local branchpredictor, a local branch prediction; performing, by the TAGE branchpredictor, a TAGE branch prediction; determining to utilize the localbranch prediction over the TAGE branch prediction as a branch predictionfor the subsequent branch instruction; incrementing the value of thecounter; determining whether the value of the counter exceeds a secondpredetermined threshold; and if the value of the counter exceeds thesecond predetermined threshold, powering down the TAGE branch predictorand configuring the branch prediction unit to bypass the TAGE branchpredictor for branch predictions of subsequent branch instructions. 2.The method of claim 1, wherein: powering down at least one of the globalbranch predictors further comprises prohibiting clocking of a globalbranch history table, a global selector, and a global count cache. 3.The method of claim 1, wherein, responsive to a branch misprediction:initializing the value of the counter; and if the branch prediction unithas been configured to bypass at least one global branch predictor,reconfiguring the branch prediction unit utilize the global branchpredictor.
 4. The method of claim 1, wherein, responsive to a flushinitiated responsive to an exception: initializing the value of thecounter; and if the branch prediction unit has been configured to bypassat least one global branch predictor, reconfiguring the branchprediction unit utilize the global branch predictor.
 5. The method ofclaim 1, wherein, performing a local branch prediction further comprisesperforming a branch prediction in dependence upon an address of thebranch instruction.
 6. The method of claim 1, wherein, performing aglobal branch prediction further comprises performing a branchprediction in dependence upon a global history vector and the address ofthe branch instruction.
 7. The method of claim 6, wherein, performingthe global branch prediction further comprises performing a TAGE branchprediction in dependence upon the global history vector, a globalhistory buffer, and at tag of the branch instruction.